<head>
  <meta name='layout' content='register'/>
<title><g:message code='spring.security.ui.register.title'/></title>
</head>

<body>

  <p/>

<s2ui:form width='650' height='300' elementId='loginFormContainer'
           titleCode='spring.security.ui.register.description' center='true'>

  <g:form action='register' name='registerForm'>

    <g:if test='${emailSent}'>
      <br/>
      <g:message code='spring.security.ui.register.sent'/>
    </g:if>
    <g:else>

      <br/>

      <table>
        <tbody>

        <s2ui:textFieldRow name='email' bean="${command}" value="${command.email}"
                           size='40' labelCode='user.email.label' labelCodeDefault='E-mail'/>

        <s2ui:passwordFieldRow name='password' labelCode='user.password.label' bean="${command}"
                               size='40' labelCodeDefault='Password' value="${command.password}"/>

        <s2ui:passwordFieldRow name='password2' labelCode='user.password2.label' bean="${command}"
                               size='40' labelCodeDefault='Password (again)' value="${command.password2}"/>

        <s2ui:textFieldRow name='name' bean="${command}" value="${command.name}"
                           size='40' labelCode='user.name.label' labelCodeDefault='Name'/>

        <s2ui:textFieldRow name='lastname' bean="${command}" value="${command.lastname}"
                           size='40' labelCode='user.lastname.label' labelCodeDefault='Lastname'/>

        <s2ui:textFieldRow name='address1' bean="${command}" value="${command.address1}"
                           size='40' labelCode='user.address1.label' labelCodeDefault='Address1'/>

        <s2ui:textFieldRow name='address2' bean="${command}" value="${command.address2}"
                           size='40' labelCode='user.address2.label' labelCodeDefault='Address2'/>

        <s2ui:textFieldRow name='postal' bean="${command}" value="${command.postal}"
                           size='40' labelCode='user.postal.label' labelCodeDefault='Postal'/>

        <s2ui:textFieldRow name='phonenumber' bean="${command}" value="${command.phonenumber}"
                           size='40' labelCode='user.phonenumber.label' labelCodeDefault='PhoneNumber'/>
        </tbody>
      </table>

      <s2ui:submitButton elementId='create' form='registerForm' messageCode='spring.security.ui.register.submit'/>

    </g:else>

  </g:form>

</s2ui:form>

<script>
$(document).ready(function() {
$('#username').focus();
});
</script>

</body>
